Closed
Conversation
Co-authored-by: imsyy <[email protected]>
Co-authored-by: imsyy <[email protected]>
Co-authored-by: imsyy <[email protected]>
Copilot
AI
changed the title
[WIP] Refactor download manager for Rust directory scanning and taskbar color
refactor: 提升代码质量 - 类型安全、消除重复、修复数据转换
Feb 11, 2026
Owner
|
@copilot 你写的也是 💩 😆 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
代码审查发现类型安全问题、数据转换错误和代码重复。本次重构修复这些问题并提升整体代码质量。
修复数据转换错误
processMusicList: 恢复duration秒转毫秒和size字节保留(前端需要原始字节数供formatFileSize处理)Local/layout.vue: 修复allMusicSize计算(字节 → GB)消除
any类型,增强类型安全Artist、ProcessedMusicTrack、ScanEvent(含Progress/Batch/End子类型)getArtistNames的any参数: 使用Artist | Artist[](err, event: ScanEvent | null) => void消除代码重复
创建
utils/paths.ts统一路径管理,消除ipc-file.ts和LocalMusicService中的重复getCoverDir实现(-15 行):其他优化
LocalMusicDB.escapeLike为私有方法() => {}质量验证: ✅ Code Review (0 issues) | ✅ CodeQL (0 alerts)
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.